<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Service_StrikeIron: Bundled Services - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.service.strikeiron.bundled-services.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.service.strikeiron.bundled-services.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.service.strikeiron.bundled-services" class="section"><div class="info"><h1 class="title">Zend_Service_StrikeIron: Bundled Services</h1></div>
    

    <p class="para">
        <span class="classname">Zend_Service_StrikeIron</span> comes with wrapper classes for three popular
        StrikeIron services.
    </p>

    <div class="section" id="zend.service.strikeiron.bundled-services.zip-code-information"><div class="info"><h1 class="title">ZIP Code Information</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Service_StrikeIron_ZipCodeInfo</span> provides a client for
            StrikeIron&#039;s Zip Code Information Service. For more information on this service, visit
            these StrikeIron resources:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                      <a href="http://www.strikeiron.com/ProductDetail.aspx?p=267" class="link external">&raquo; Zip Code
                          Information Service Page</a>
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                      <a href="http://sdpws.strikeiron.com/zf1.StrikeIron/sdpZIPCodeInfo?WSDL" class="link external">&raquo; Zip
                          Code Information Service WSDL</a>
                    </p>
                </li>
            </ul>

            The service contains a  <span class="methodname">getZipCode()</span> method that will retrieve
            information about a United States ZIP code or Canadian postal code:
        </p>

        <pre class="programlisting brush: php">
$strikeIron = new Zend_Service_StrikeIron(array(&#039;username&#039; =&gt; &#039;your-username&#039;,
                                                &#039;password&#039; =&gt; &#039;your-password&#039;));

// Get a client for the Zip Code Information service
$zipInfo = $strikeIron-&gt;getService(array(&#039;class&#039; =&gt; &#039;ZipCodeInfo&#039;));

// Get the Zip information for 95014
$response = $zipInfo-&gt;getZipCode(array(&#039;ZipCode&#039; =&gt; 95014));
$zips = $response-&gt;serviceResult;

// Display the results
if ($zips-&gt;count == 0) {
    echo &#039;No results found&#039;;
} else {
    // a result with one single zip code is returned as an object,
    // not an array with one element as one might expect.
    if (! is_array($zips-&gt;zipCodes)) {
        $zips-&gt;zipCodes = array($zips-&gt;zipCodes);
    }

    // print all of the possible results
    foreach ($zips-&gt;zipCodes as $z) {
        $info = $z-&gt;zipCodeInfo;

        // show all properties
        print_r($info);

        // or just the city name
        echo $info-&gt;preferredCityName;
    }
}

// Detailed status information
// http://www.strikeiron.com/exampledata/StrikeIronZipCodeInformation_v3.pdf
$status = $response-&gt;serviceStatus;
</pre>

    </div>

    <div class="section" id="zend.service.strikeiron.bundled-services.us-address-verification"><div class="info"><h1 class="title">U.S. Address Verification</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Service_StrikeIron_USAddressVerification</span> provides a client
            for StrikeIron&#039;s U.S. Address Verification Service. For more information on this
            service, visit these StrikeIron resources:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <a href="http://www.strikeiron.com/ProductDetail.aspx?p=198" class="link external">&raquo; U.S. Address
                            Verification Service Page</a>
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <a href="http://ws.strikeiron.com/zf1.StrikeIron/USAddressVerification4_0?WSDL" class="link external">&raquo; U.S.
                            Address Verification Service WSDL</a>
                    </p>
                </li>
            </ul>
        </p>

        <p class="para">
            The service contains a  <span class="methodname">verifyAddressUSA()</span> method that will
            verify an address in the United States:
        </p>

        <pre class="programlisting brush: php">
$strikeIron = new Zend_Service_StrikeIron(array(&#039;username&#039; =&gt; &#039;your-username&#039;,
                                                &#039;password&#039; =&gt; &#039;your-password&#039;));

// Get a client for the Zip Code Information service
$verifier = $strikeIron-&gt;getService(array(&#039;class&#039; =&gt; &#039;USAddressVerification&#039;));

// Address to verify. Not all fields are required but
// supply as many as possible for the best results.
$address = array(&#039;firm&#039;           =&gt; &#039;Zend Technologies&#039;,
                 &#039;addressLine1&#039;   =&gt; &#039;19200 Stevens Creek Blvd&#039;,
                 &#039;addressLine2&#039;   =&gt; &#039;&#039;,
                 &#039;city_state_zip&#039; =&gt; &#039;Cupertino CA 95014&#039;);

// Verify the address
$result = $verifier-&gt;verifyAddressUSA($address);

// Display the results
if ($result-&gt;addressErrorNumber != 0) {
    echo $result-&gt;addressErrorNumber;
    echo $result-&gt;addressErrorMessage;
} else {
    // show all properties
    print_r($result);

    // or just the firm name
    echo $result-&gt;firm;

    // valid address?
    $valid = ($result-&gt;valid == &#039;VALID&#039;);
}
</pre>

    </div>

    <div class="section" id="zend.service.strikeiron.bundled-services.sales-use-tax-basic"><div class="info"><h1 class="title">Sales &amp; Use Tax Basic</h1></div>
        

        <p class="para">
            <span class="classname">Zend_Service_StrikeIron_SalesUseTaxBasic</span> provides a client for
            StrikeIron&#039;s Sales &amp; Use Tax Basic service. For more information on this
            service, visit these StrikeIron resources:

            <ul class="itemizedlist">
                <li class="listitem">
                    <p class="para">
                        <a href="http://www.strikeiron.com/ProductDetail.aspx?p=351" class="link external">&raquo; Sales &amp;
                            Use Tax Basic Service Page</a>
                    </p>
                </li>

                <li class="listitem">
                    <p class="para">
                        <a href="http://ws.strikeiron.com/zf1.StrikeIron/taxdatabasic4?WSDL" class="link external">&raquo; Sales
                            &amp; Use Tax Basic Service WSDL</a>
                    </p>
                </li>
            </ul>
        </p>

        <p class="para">
            The service contains two methods,  <span class="methodname">getTaxRateUSA()</span> and
             <span class="methodname">getTaxRateCanada()</span>, that will retrieve sales and use tax data
            for the United States and Canada, respectively.
        </p>

        <pre class="programlisting brush: php">
$strikeIron = new Zend_Service_StrikeIron(array(&#039;username&#039; =&gt; &#039;your-username&#039;,
                                                &#039;password&#039; =&gt; &#039;your-password&#039;));

// Get a client for the Sales &amp; Use Tax Basic service
$taxBasic = $strikeIron-&gt;getService(array(&#039;class&#039; =&gt; &#039;SalesUseTaxBasic&#039;));

// Query tax rate for Ontario, Canada
$rateInfo = $taxBasic-&gt;getTaxRateCanada(array(&#039;province&#039; =&gt; &#039;foo&#039;));
print_r($rateInfo);               // show all properties
echo $rateInfo-&gt;GST;              // or just the GST (Goods &amp; Services Tax)

// Query tax rate for Cupertino, CA USA
$rateInfo = $taxBasic-&gt;getTaxRateUS(array(&#039;zip_code&#039; =&gt; 95014));
print_r($rateInfo);               // show all properties
echo $rateInfo-&gt;state_sales_tax;  // or just the state sales tax
</pre>

    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="reference.html">Zend Framework Reference</a></li>
  <li class="header up"><a href="zend.service.html">Zend_Service</a></li>
  <li><a href="zend.service.introduction.html">Introduction</a></li>
  <li><a href="zend.service.akismet.html">Zend_Service_Akismet</a></li>
  <li><a href="zend.service.amazon.html">Zend_Service_Amazon</a></li>
  <li><a href="zend.service.amazon.ec2.html">Zend_Service_Amazon_Ec2</a></li>
  <li><a href="zend.service.amazon.ec2.instance.html">Zend_Service_Amazon_Ec2: Instances</a></li>
  <li><a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a></li>
  <li><a href="zend.service.amazon.ec2.reserved.instance.html">Zend_Service_Amazon_Ec2: Reserved Instances</a></li>
  <li><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></li>
  <li><a href="zend.service.amazon.ec2.images.html">Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)</a></li>
  <li><a href="zend.service.amazon.ec2.ebs.html">Zend_Service_Amazon_Ec2: Elastic Block Storage (EBS)</a></li>
  <li><a href="zend.service.amazon.ec2.elasticip.html">Zend_Service_Amazon_Ec2: Elastic IP Addresses</a></li>
  <li><a href="zend.service.amazon.ec2.keypairs.html">Zend_Service_Amazon_Ec2: Keypairs</a></li>
  <li><a href="zend.service.amazon.ec2.zones.html">Zend_Service_Amazon_Ec2: Regions and Availability Zones</a></li>
  <li><a href="zend.service.amazon.ec2.securitygroups.html">Zend_Service_Amazon_Ec2: Security Groups</a></li>
  <li><a href="zend.service.amazon.s3.html">Zend_Service_Amazon_S3</a></li>
  <li><a href="zend.service.amazon.sqs.html">Zend_Service_Amazon_Sqs</a></li>
  <li><a href="zend.service.audioscrobbler.html">Zend_Service_Audioscrobbler</a></li>
  <li><a href="zend.service.delicious.html">Zend_Service_Delicious</a></li>
  <li><a href="zend.service.developergarden.html">Zend_Service_DeveloperGarden</a></li>
  <li><a href="zend.service.ebay.html">Zend_Service_Ebay</a></li>
  <li><a href="zend.service.ebay.finding.html">Zend_Service_Ebay_Finding</a></li>
  <li><a href="zend.service.flickr.html">Zend_Service_Flickr</a></li>
  <li><a href="zend.service.livedocx.html">Zend_Service_LiveDocx</a></li>
  <li><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></li>
  <li><a href="zend.service.recaptcha.html">Zend_Service_ReCaptcha</a></li>
  <li><a href="zend.service.short-url.html">Zend_Service_ShortUrl</a></li>
  <li><a href="zend.service.simpy.html">Zend_Service_Simpy</a></li>
  <li><a href="zend.service.slideshare.html">Zend_Service_SlideShare</a></li>
  <li><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></li>
  <li class="active"><a href="zend.service.strikeiron.bundled-services.html">Zend_Service_StrikeIron: Bundled Services</a></li>
  <li><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></li>
  <li><a href="zend.service.technorati.html">Zend_Service_Technorati</a></li>
  <li><a href="zend.service.twitter.html">Zend_Service_Twitter</a></li>
  <li><a href="zend.service.windowsazure.html">Zend_Service_WindowsAzure</a></li>
  <li><a href="zend.service.windowsazure.storage.blob.html">Zend_Service_WindowsAzure_Storage_Blob</a></li>
  <li><a href="zend.service.windowsazure.diagnostics.manager.html">Zend_Service_WindowsAzure_Diagnostics_Manager</a></li>
  <li><a href="zend.service.windowsazure.storage.queue.html">Zend_Service_WindowsAzure_Storage_Queue</a></li>
  <li><a href="zend.service.windowsazure.storage.table.html">Zend_Service_WindowsAzure_Storage_Table</a></li>
  <li><a href="zend.service.yahoo.html">Zend_Service_Yahoo</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>